/*
 * @Author: dadadaXU 1413107032@qq.com
 * @Date: 2025-01-03 11:13:18
 * @LastEditors: dadadaXU 1413107032@qq.com
 * @LastEditTime: 2025-01-05 16:30:50
 * @FilePath: /FileBackup/test/test_FileCompress.cpp
 * @Description: 文件压缩功能测试
 */

#include <gtest/gtest.h>
#include <iostream>
#include <vector>
#include <string>
#include "../include/fileCompress.hpp"

class FileCompressTest : public ::testing::Test
{
protected:
    FileCompressor *compressor;

    std::filesystem::path sourceFilePath, packPath;

    void SetUp() override
    {
        std::cout << "sourceFilePath: ";
        std::cin >> sourceFilePath;
        std::cout << "packPath: ";
        std::cin >> packPath;

        compressor = new FileCompressor(sourceFilePath, packPath);
    }

    void TearDown() override
    {
        if (compressor != nullptr)
        {
            delete compressor;
            compressor = nullptr;
        }
    }
};

TEST_F(FileCompressTest, compress)
{
    EXPECT_TRUE(compressor->Compress());
}

TEST_F(FileCompressTest, decompress)
{
    EXPECT_TRUE(compressor->Decompress(false));
}

/**
 * `--gtest_filter=FileCompressTest.decompress`
 */
int main(int argc, char **argv)
{
    ::testing::InitGoogleTest(&argc, argv);

    return RUN_ALL_TESTS();
}
